

/* Replication code for table 2 */

/* welfare experiment (1qn) */

use "C:\Users\ls42\Dropbox\google consumer surveys\Replication Materials\framing_1qn.dta", clear


/* for welfare experiment (1-question survey), we create a variable saidtoolittle where 1=respondents answer too little and 0=otherwise */

gen saidtoolittle=0 
replace saidtoolittle=. if answer==2 /* remove dont'knows */
replace saidtoolittle=1 if answer==3

tab saidtoolittle group, col  /*this is to calculate the percentage of respondents saying too little by treatment group 
                               (results shown in row 1 and 2, coloumn 5 of table 2). Note that for the group variable,
							   c=assistance to the poor and t=welfare. */


tab saidtoolittle, gen(saidtoolittle)
prtest saidtoolittle2, by(group)  /* diff. in proportion test for respondents saying too little across treatment groups */



/* welfare experiment (10qn) */

use "C:\Users\ls42\Dropbox\google consumer surveys\Replication Materials\framing_10qn.dta", clear


/* for welfare experiment (10-question survey), we also create a variable saidtoolittle where 1=respondents answer too little and 0=otherwise */

gen saidtoolittle=0
replace saidtoolittle=. if Question3Answer=="Don't Know" /* remove dont'knows */
replace saidtoolittle=1 if Question3Answer=="Too Little"


tab saidtoolittle group, col   /*this is to calculate the percentage of respondents saying too little by treatment group 
                               (results shown in row 1 and 2, coloumn 6 of table 2). Note that for the group variable,
							   c=assistance to the poor and t=welfare. */

							   
tab saidtoolittle, gen(saidtoolittle)
prtest saidtoolittle2, by(group)  /* diff. in proportion test for respondents saying too little across treatment groups */							   
							   

/* Replication code for table 3 */

use "C:\Users\ls42\Dropbox\google consumer surveys\Replication Materials\asian_disease.dta", clear

/* for asian disease experiment, we create a variable certainchoice where 1=respondents choosing certian choice (i.e. Program A)
    and 0=otherwise */

gen certainchoice =0
replace certainchoice=. if answer==1 /* remove dont'knows */
replace certainchoice=1 if answer==2


tab certainchoice group, col  /*this is to calculate the percentage of respondents choosing certain choice by treatment group 
                               (results shown in row 1 and 2, coloumn 8 of table 3). Note that for the group variable,
							   c=Lives saved condition and t=Lives lost condition. */
							   
tab certainchoice, gen(certainchoice)
prtest certainchoice2, by(group)  /* diff. in proportion test for respondents choosing certain choice across treatment groups */		


/* Replication code for table 4 */

/* list experiment (female prez) */

use "C:\Users\ls42\Dropbox\google consumer surveys\Replication Materials\list_femaleprez.dta", clear

sum answer if group==1 /* control group (results shown in row 1 coloumn 5 of table 4) */ 
sum answer if group==2 /* treatment group (results shown in row 2 coloumn 5 of table 4) */

ttest answer, by(group) /*diff. in means test for 2 groups*/

/* list experiment (immigration) */

use "C:\Users\ls42\Dropbox\google consumer surveys\Replication Materials\list_immg.dta", clear

sum answer if group==1   /*control group (results shown in row 1 coloumn 3 of table 4) */
sum answer if group==2 /*treatment group (results shown in row 2 coloumn 3 of table 4 */

ttest answer, by(group) /*diff. in means test for 2 groups*/


/* Replication for table 5 */

use "C:\Users\ls42\Dropbox\google consumer surveys\Replication Materials\framing_10qn.dta", clear

/*we  create a variable saidtoolittle where 1=respondents answer too little and 0=otherwise */

gen saidtoolittle=0
replace saidtoolittle=. if Question3Answer=="Don't Know" /* remove dont'knows */
replace saidtoolittle=1 if Question3Answer=="Too Little"

/* results for all respondents */

tab saidtoolittle group, col   /*this is to calculate the percentage of respondents saying too little by treatment group 
                               (results shown in row 1, coloumn 2 and 3 of table 5) */

/* create variable for manipulation check */ 

gen gotMCright=0 
replace gotMCright=1 if group==1&Question4Answer=="Assistance to the poor"
replace gotMCright=1 if group==2&Question4Answer=="Welfare"

tab gotMCright if group==1 /* calculate the percentage who get MC right in assistance to the poor condition. the results is 75.6% and it is 
                               discussed in the 3rd paragraph of page 11 */

tab gotMCright if group==2  /* calculate the percentage who get MC right in welfare condition. the results is 75.3%  and it is 
                               discussed in the 3rd paragraph of page 11 */ 
							   
tab saidtoolittle group if gotMCright==1, col   /*this is to calculate the percentage of respondents 
                                                 saying too little by treatment group and pass the manipulation check (results shown in row 2, coloumn 2 and 3 of table 5) */
							   
tab saidtoolittle group if gotMCright==0, col   /*this is to calculate the percentage of respondents
                                                 saying too little by treatment group and fail the manipulation check (results shown in row 3, coloumn 2 and 3 of table 5) */


/* create variable for response time*/ 

gen newtime=regexr( ResponseTime3,"ms","")
destring newtime, replace


/* the three results below are discussed in the last paragraph of page 11 */

sum newtime if gotMCright==1 /* ave time spent on treatment qn for those who pass MC */
sum newtime if gotMCright==0 /* ave time spent on treatment qn for those who fail MC */
tab gotMCright if newtime>4000 /* proportion of those who got MC right and took more than 4s */ 

tab saidtoolittle group if newtime>4000, col  /*this is to calculate the percentage of respondents  
                                                 saying too little by treatment group and took more than 4s (results shown in row 4, coloumn 2 and 3 of table 5) */

tab saidtoolittle group if newtime<4000, col  /*this is to calculate the percentage of respondents 
                                                 saying too little by treatment group and took less than 4s (results shown in row 4, coloumn 2 and 3 of table 5) */												 
												 


/* manipulation check for asian disease and 1 qn framing experiment using response time. the results are discussed in the 2nd paragraph of page 12 */ 

use "C:\Users\ls42\Dropbox\google consumer surveys\Replication Materials\asian_disease.dta", clear

/* for asian disease experiment, we create a variable certainchoice where 1=respondents choosing certain choice (i.e. Program A)
    and 0=otherwise */

gen certainchoice =0
replace certainchoice=. if answer==1 /* remove dont'knows */
replace certainchoice=1 if answer==2

/* create variable for response time*/ 
gen newtime=regexr( ResponseTime1,"ms","")
destring newtime, replace

regress certainchoice group

regress certainchoice group if newtime>15000 /* we chose a cut off at 15s. Since the coefficient of the group variable from this regression output 
                                               indicate the size of the treatment effect, a coefficient of -0.28 shows that the difference in the
											   percentage of respondents across groups choosing certain choice is 28% and take more than 15s.
											   This is a 3% increase from a treatment effect of 25% when we include all respondents */ 


use "C:\Users\ls42\Dropbox\google consumer surveys\Replication Materials\framing_1qn.dta", clear

/*we create a variable saidtoolittle where 1=respondents answer too little and 0=otherwise */

gen saidtoolittle=0
replace saidtoolittle=. if answer==2 /* remove dont'knows */
replace saidtoolittle=1 if answer==3

/* create variable for response time*/ 
gen newtime=regexr( ResponseTime1,"ms","")
destring newtime, replace


regress saidtoolittle group if newtime>4000 /* we chose cut off at 4s. Since the coefficient of the group variable from this regression output 
                                               indicate the size of the treatment effect, a coefficient of -0.26 shows that the difference in the
											   percentage of respondents across groups choosing certain choice and take more than 4s is 26%. 
											   This is a 3% increase from a treatment effect of 23% when we include all respondents */  




